package com.woniuxy.order.dto;

import lombok.Data;
import javax.validation.constraints.*;
import java.math.BigDecimal;

/**
 * 订单申请DTO
 */
@Data
public class OrderApplicationDto {
    
    private Long id;
    
    @NotBlank(message = "客户名称不能为空")
    @Size(max = 100, message = "客户名称长度不能超过100个字符")
    private String customerName;
    
    @NotNull(message = "客户ID不能为空")
    private Long customerId;
    
    @NotBlank(message = "产品名称不能为空")
    @Size(max = 200, message = "产品名称长度不能超过200个字符")
    private String productName;
    
    @Size(max = 500, message = "产品规格长度不能超过500个字符")
    private String productSpec;
    
    @NotNull(message = "数量不能为空")
    @Min(value = 1, message = "数量必须大于0")
    private Integer quantity;
    
    @NotNull(message = "单价不能为空")
    @DecimalMin(value = "0.01", message = "单价必须大于0")
    @Digits(integer = 8, fraction = 2, message = "单价格式不正确")
    private BigDecimal unitPrice;
    
    @NotNull(message = "总金额不能为空")
    @DecimalMin(value = "0.01", message = "总金额必须大于0")
    @Digits(integer = 13, fraction = 2, message = "总金额格式不正确")
    private BigDecimal totalAmount;
    
    @NotBlank(message = "收货地址不能为空")
    @Size(max = 500, message = "收货地址长度不能超过500个字符")
    private String deliveryAddress;
    
    @NotBlank(message = "联系人不能为空")
    @Size(max = 50, message = "联系人长度不能超过50个字符")
    private String contactPerson;
    
    @NotBlank(message = "联系电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系电话格式不正确")
    private String contactPhone;
    
    @Size(max = 1000, message = "订单描述长度不能超过1000个字符")
    private String orderDescription;
    
    private String applicationStatus;
    private String processInstanceId;
    private String currentApprover;
    private String currentStep;
    private String rejectReason;
    private String rejectStep;
}

